{% extends "base.html" %}
{% block header %}
<link rel="stylesheet" type="text/css" href="/static/css/forms.css">
<script type="text/javascript">
function reset(){
    $('#reason').val();
}

function replay(){
    var rt = $('#rtype').val();    
    if(!rt){
        alert("故障类型不能为空!");
        return false
    } 
    var reason = $('#reason').val();
    if(!reason){
        alert("报警原因不能为空");
    }else{
        document.reason.submit();
    }
}

</script>
{% endblock %}

{% block menu %}
    {% include "alert-menu.html" %}
{% endblock %}

{% block content %}
 <div id="mon-tit">
        <div class="left">报警管理 >> 报警列表</div>
</div>
    <div class="clr"></div>
    <hr>
    <h3 class="tit">故障历史汇总</h3>
    <table>


    <form name='reason' action="" method="post"  enctype="multipart/form-data">
        <div class="module aligned">
 

            <div  class="form-row">
                <label>监控名称：</label>
                <span>{{ alt.mid.mname }}<span>
            </div>

            <div  class="form-row">
                <label>报警日期：</label>
                <span>{{ alt.timestamp|date:"Y-m-d H:i:s" }} </span>
            </div>

            <div  class="form-row">
                <label>持续时间：</label>
                <span>{{ alt.downtime }}<span>
            </div>

            <div  class="form-row">
                <label>对应主机：</label>
                <span>{{ alt.mid.hid.ip }}<span>
            </div>

            <div  class="form-row">
                <label>故障类型：</label>
             <select name="rtype" id="rtype" style="width:200px">
                <option selected="selected" value="">---------</option>
                <option value="闪断">闪断</option>
                <option value="程序BUG">程序BUG</option>
                <option value="人为操作">人为操作</option>
                <option value="负载过大">负载过大</option>
                <option value="网络故障">网络故障</option>
                <option value="其他">其他</option>
            </select>
            </div>


            <div  class="form-row">
                <label for="reason" >报警原因：</label>
                <textarea id="reason" name="reason" rows=10 cols=60 ></textarea> 
            </div>

        {% for field in form %}
            <div class="form-row">

            </div>
        {% endfor %}

        <div style='text-align:center'>
            <button type="button" style="margin-right:40px;width:80px" onclick="reset()" >重置</button>
            <button type="button" style="margin-right:40px;width:80px" onclick="replay()" >提交</button>
        </div>
    </div>
    </form>

   </table>
{% endblock %}

